/**
  ******************************************************************************
  * @author     Chris
  * @since      2023/10/11 13:57
  *
  * @file       pd_h_timer.h
  * @brief      Head file of Hardware Peripheral Driver of TIM.
  *
  * @note       This file contains the function declaration for the Hardware
  *             Peripheral Driver of TIM.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date           Author       Notes
  *   2023/10/11     Chris        the first version
  *
  ******************************************************************************
  */

#ifndef JXTech_TIMER_H
#define JXTech_TIMER_H

#include "stm32g4xx.h"

void PD_H_TIM2_TimerInit(void);


void PD_H_TIM3_ETRInit(void);

uint16_t PD_H_TIM3_GetCounter(void);


void PD_H_TIM4_PWMInit(void);

void PD_H_TIM4_SetPWMDuty(uint32_t channel, uint32_t val);

void PD_H_TIM4_SetPWMFreq(uint32_t val);


void PD_H_TIM15_PWMInit(void);

void PD_H_TIM15_SetPWMDuty(uint32_t channel, int8_t val);


void PD_H_TIM16_ICInit(void);

uint32_t PD_H_TIM16_GetFreq(void);

uint32_t PD_H_TIM16_GetDuty(void);


void PD_H_TIM8_EncoderInit(void);

int16_t PD_H_TIM8_GetEncoder(void);

#endif
